<?php
namespace app\common\controller;

use app\common\controller\Base;

class Back extends Base
{
    //过滤规则
    protected $filter = 'trim';

    //错误提示
    protected $error = '参数错误';

    //继承上级
    protected function initialize()
    {
        $this->auth['check'] = true;

        $this->auth['cancel_login'] = ['admin/login/index','admin/login/update'];

        $this->auth['cancel_limit'] = ['admin/login/index'];

        $this->auth['error_login'] = 'admin/login/index';

        $this->auth['error_limit'] = 'admin/login/index';

        parent::initialize();
        
        $this->authCheck();

        $this->site['pathView']   = $this->site['rootUrl'].'/view/default';

        $this->view->config('view_base', './view/default/');
    }

    //保存配置
    protected function configSave($fileName='./config/test.php', $array=[], $path='admin/site/index')
    {
        if(dcWriteArray($fileName, $array)){
            $this->success('成功', $path);
        }else{
            $this->error('请检查'.$fileName.'是否存在并且需要有写入权限');
        }
    }
}